<template>
  <van-nav-bar v-bind="$attrs" v-on="$listeners">
    <template #title>
      <span class="flex items-center">
        <van-image
          :src="require('../assets/logo.png')"
          round
          width="1rem"
          height="1rem"
        >
        </van-image>
        <span class="ml-1">{{ title }} </span>
      </span>
    </template>
  </van-nav-bar>
</template>

<script>
export default {
  data() {
    return {
      title: '',
    }
  },
  watch: {
    '$route.path': {
      immediate: true,
      handler: function(val, old) {
        this.title = this.$route.meta.title
      },
    },
  },
}
</script>

<style>
</style>